package com.avalonsql.core.db.objects.impl;

@MetaData(caption = "Column")
public class StoredProcedureColumn extends DBObject<StoredProcedure> {

    private String typeName;
    private boolean nullable;
    private int size;

    public StoredProcedureColumn(String schema, String catalog, String name, String typeName, boolean nullable, int size, StoredProcedure parent) {
        super(schema, catalog, name, parent);
        if (name == null) {
            throw new IllegalArgumentException("name = null");
        }
        if (typeName == null) {
            throw new IllegalArgumentException("typeName = null");
        }
        if (parent == null) {
            throw new IllegalArgumentException("parent = null");
        }
        this.typeName = typeName;
        this.nullable = nullable;
        this.size = size;
    }

    @MetaData(caption = "Type Name")
    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        if (typeName == null) {
            throw new IllegalArgumentException("typeName = null");
        }
        this.typeName = typeName;
    }

    @MetaData(caption = "Nullable")
    public boolean isNullable() {
        return nullable;
    }

    public void setNullable(boolean nullable) {
        this.nullable = nullable;
    }

    @MetaData(caption = "Size")
    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

}
